Imports System.Data
Imports System.Xml
Imports System.Data.SqlClient
Imports AppsUtility.EncDec
Imports System.Web.Mail
Imports System.Text
Imports Microsoft.Office.Core
Imports System.Configuration

Public Class frmProductMasterAdd

    Inherits System.Windows.Forms.Form
    'Dim icp As ICproducts

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents Label13 As System.Windows.Forms.Label
    Friend WithEvents Label14 As System.Windows.Forms.Label
    Friend WithEvents Label15 As System.Windows.Forms.Label
    Friend WithEvents Label16 As System.Windows.Forms.Label
    Friend WithEvents Label17 As System.Windows.Forms.Label
    Friend WithEvents Label18 As System.Windows.Forms.Label
    Friend WithEvents Label19 As System.Windows.Forms.Label
    Friend WithEvents Label20 As System.Windows.Forms.Label
    Friend WithEvents Label22 As System.Windows.Forms.Label
    Friend WithEvents chOnPromotion As System.Windows.Forms.CheckBox
    Friend WithEvents tbProdCode As System.Windows.Forms.TextBox
    Friend WithEvents tbManuf As System.Windows.Forms.TextBox
    Friend WithEvents tbShortDescE As System.Windows.Forms.TextBox
    Friend WithEvents tbShortDescA As System.Windows.Forms.TextBox
    Friend WithEvents tbLongDescE As System.Windows.Forms.TextBox
    Friend WithEvents tbLongDescA As System.Windows.Forms.TextBox
    Friend WithEvents tbPrice1 As System.Windows.Forms.TextBox
    Friend WithEvents tbPrice2 As System.Windows.Forms.TextBox
    Friend WithEvents tbPrice3 As System.Windows.Forms.TextBox
    Friend WithEvents tbMarkup3 As System.Windows.Forms.TextBox
    Friend WithEvents tbMarkup2 As System.Windows.Forms.TextBox
    Friend WithEvents tbMarkup1 As System.Windows.Forms.TextBox
    Friend WithEvents tbROL As System.Windows.Forms.TextBox
    Friend WithEvents chKit As System.Windows.Forms.CheckBox
    Friend WithEvents tbImageFile As System.Windows.Forms.TextBox
    Friend WithEvents btnImage As System.Windows.Forms.Button
    Friend WithEvents tbOuterPack As System.Windows.Forms.TextBox
    Friend WithEvents tbLeadTime As System.Windows.Forms.TextBox
    Friend WithEvents chActive As System.Windows.Forms.CheckBox
    Friend WithEvents chWhProduct As System.Windows.Forms.CheckBox
    Friend WithEvents dlgOpen As System.Windows.Forms.OpenFileDialog
    Friend WithEvents pbImage As System.Windows.Forms.PictureBox
    Friend WithEvents dgShowroom As System.Windows.Forms.DataGrid
    Friend WithEvents cmbLead As System.Windows.Forms.ComboBox
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents rbStock As System.Windows.Forms.RadioButton
    Friend WithEvents rbSample As System.Windows.Forms.RadioButton
    Friend WithEvents rbNonStock As System.Windows.Forms.RadioButton
    Friend WithEvents ttHelp As System.Windows.Forms.ToolTip
    Friend WithEvents Label21 As System.Windows.Forms.Label
    Friend WithEvents dgSuppliers As System.Windows.Forms.DataGrid
    Friend WithEvents dgBarcode As System.Windows.Forms.DataGrid
    Friend WithEvents cmbGroup7 As System.Windows.Forms.ComboBox
    Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
    Friend WithEvents rbActiveProd As System.Windows.Forms.RadioButton
    Friend WithEvents rbRangedOut As System.Windows.Forms.RadioButton
    Friend WithEvents rbTempDisc As System.Windows.Forms.RadioButton
    Friend WithEvents rbToBePurged As System.Windows.Forms.RadioButton
    Friend WithEvents CmbGroup8 As System.Windows.Forms.ComboBox
    Friend WithEvents rbNIOH As System.Windows.Forms.RadioButton
    Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
    Friend WithEvents dgProduct As System.Windows.Forms.DataGrid
    Friend WithEvents Label23 As System.Windows.Forms.Label
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Label24 As System.Windows.Forms.Label
    Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
    Friend WithEvents Label25 As System.Windows.Forms.Label
    Friend WithEvents Label26 As System.Windows.Forms.Label
    Friend WithEvents Label27 As System.Windows.Forms.Label
    Friend WithEvents Label28 As System.Windows.Forms.Label
    Friend WithEvents Label29 As System.Windows.Forms.Label
    Friend WithEvents dtpLPD As System.Windows.Forms.DateTimePicker
    Friend WithEvents chkLPD As System.Windows.Forms.CheckBox
    Friend WithEvents cmbDepartment As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbBrand As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbSubCat As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbManuf As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbSubSubCat As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbCategory As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbUnit As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbPack As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbPOfilter As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmdSave As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmdExit As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmdOpen As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmdFilter As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmdDisplay As DevComponents.DotNetBar.ButtonX
    Friend WithEvents GroupPanel1 As DevComponents.DotNetBar.Controls.GroupPanel
    Friend WithEvents rbPCI As System.Windows.Forms.RadioButton
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmProductMasterAdd))
        Me.rbStock = New System.Windows.Forms.RadioButton()
        Me.rbSample = New System.Windows.Forms.RadioButton()
        Me.rbNonStock = New System.Windows.Forms.RadioButton()
        Me.chOnPromotion = New System.Windows.Forms.CheckBox()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.tbProdCode = New System.Windows.Forms.TextBox()
        Me.tbManuf = New System.Windows.Forms.TextBox()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.tbShortDescE = New System.Windows.Forms.TextBox()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.tbShortDescA = New System.Windows.Forms.TextBox()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.tbLongDescE = New System.Windows.Forms.TextBox()
        Me.tbLongDescA = New System.Windows.Forms.TextBox()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.tbPrice1 = New System.Windows.Forms.TextBox()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.tbPrice2 = New System.Windows.Forms.TextBox()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.tbPrice3 = New System.Windows.Forms.TextBox()
        Me.Label10 = New System.Windows.Forms.Label()
        Me.tbMarkup3 = New System.Windows.Forms.TextBox()
        Me.Label11 = New System.Windows.Forms.Label()
        Me.tbMarkup2 = New System.Windows.Forms.TextBox()
        Me.Label12 = New System.Windows.Forms.Label()
        Me.tbMarkup1 = New System.Windows.Forms.TextBox()
        Me.Label13 = New System.Windows.Forms.Label()
        Me.tbROL = New System.Windows.Forms.TextBox()
        Me.Label14 = New System.Windows.Forms.Label()
        Me.chKit = New System.Windows.Forms.CheckBox()
        Me.tbImageFile = New System.Windows.Forms.TextBox()
        Me.Label15 = New System.Windows.Forms.Label()
        Me.btnImage = New System.Windows.Forms.Button()
        Me.dgShowroom = New System.Windows.Forms.DataGrid()
        Me.Label16 = New System.Windows.Forms.Label()
        Me.Label17 = New System.Windows.Forms.Label()
        Me.Label18 = New System.Windows.Forms.Label()
        Me.Label19 = New System.Windows.Forms.Label()
        Me.tbOuterPack = New System.Windows.Forms.TextBox()
        Me.tbLeadTime = New System.Windows.Forms.TextBox()
        Me.Label20 = New System.Windows.Forms.Label()
        Me.chActive = New System.Windows.Forms.CheckBox()
        Me.cmbLead = New System.Windows.Forms.ComboBox()
        Me.chWhProduct = New System.Windows.Forms.CheckBox()
        Me.Label22 = New System.Windows.Forms.Label()
        Me.dlgOpen = New System.Windows.Forms.OpenFileDialog()
        Me.pbImage = New System.Windows.Forms.PictureBox()
        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
        Me.ttHelp = New System.Windows.Forms.ToolTip(Me.components)
        Me.dgBarcode = New System.Windows.Forms.DataGrid()
        Me.Label21 = New System.Windows.Forms.Label()
        Me.dgSuppliers = New System.Windows.Forms.DataGrid()
        Me.cmbGroup7 = New System.Windows.Forms.ComboBox()
        Me.GroupBox2 = New System.Windows.Forms.GroupBox()
        Me.rbPCI = New System.Windows.Forms.RadioButton()
        Me.rbActiveProd = New System.Windows.Forms.RadioButton()
        Me.rbTempDisc = New System.Windows.Forms.RadioButton()
        Me.rbNIOH = New System.Windows.Forms.RadioButton()
        Me.rbRangedOut = New System.Windows.Forms.RadioButton()
        Me.rbToBePurged = New System.Windows.Forms.RadioButton()
        Me.CmbGroup8 = New System.Windows.Forms.ComboBox()
        Me.GroupBox3 = New System.Windows.Forms.GroupBox()
        Me.cmdFilter = New DevComponents.DotNetBar.ButtonX()
        Me.Label24 = New System.Windows.Forms.Label()
        Me.dgProduct = New System.Windows.Forms.DataGrid()
        Me.cmbPOfilter = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.Label23 = New System.Windows.Forms.Label()
        Me.TextBox1 = New System.Windows.Forms.TextBox()
        Me.GroupBox4 = New System.Windows.Forms.GroupBox()
        Me.Label25 = New System.Windows.Forms.Label()
        Me.Label26 = New System.Windows.Forms.Label()
        Me.Label27 = New System.Windows.Forms.Label()
        Me.Label28 = New System.Windows.Forms.Label()
        Me.Label29 = New System.Windows.Forms.Label()
        Me.dtpLPD = New System.Windows.Forms.DateTimePicker()
        Me.chkLPD = New System.Windows.Forms.CheckBox()
        Me.cmbDepartment = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbBrand = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbSubCat = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbManuf = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbSubSubCat = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbCategory = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbUnit = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbPack = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmdSave = New DevComponents.DotNetBar.ButtonX()
        Me.cmdExit = New DevComponents.DotNetBar.ButtonX()
        Me.cmdOpen = New DevComponents.DotNetBar.ButtonX()
        Me.cmdDisplay = New DevComponents.DotNetBar.ButtonX()
        Me.GroupPanel1 = New DevComponents.DotNetBar.Controls.GroupPanel()
        CType(Me.dgShowroom, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.pbImage, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.GroupBox1.SuspendLayout()
        CType(Me.dgBarcode, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.dgSuppliers, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.GroupBox2.SuspendLayout()
        Me.GroupBox3.SuspendLayout()
        CType(Me.dgProduct, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.GroupBox4.SuspendLayout()
        Me.GroupPanel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'rbStock
        '
        Me.rbStock.AutoSize = True
        Me.rbStock.Checked = True
        Me.rbStock.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbStock.Location = New System.Drawing.Point(6, 22)
        Me.rbStock.Name = "rbStock"
        Me.rbStock.Size = New System.Drawing.Size(59, 22)
        Me.rbStock.TabIndex = 9
        Me.rbStock.TabStop = True
        Me.rbStock.Text = "Stock"
        '
        'rbSample
        '
        Me.rbSample.AutoSize = True
        Me.rbSample.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbSample.Location = New System.Drawing.Point(6, 49)
        Me.rbSample.Name = "rbSample"
        Me.rbSample.Size = New System.Drawing.Size(78, 22)
        Me.rbSample.TabIndex = 11
        Me.rbSample.Text = "Samples"
        '
        'rbNonStock
        '
        Me.rbNonStock.AutoSize = True
        Me.rbNonStock.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbNonStock.Location = New System.Drawing.Point(6, 75)
        Me.rbNonStock.Name = "rbNonStock"
        Me.rbNonStock.Size = New System.Drawing.Size(90, 22)
        Me.rbNonStock.TabIndex = 12
        Me.rbNonStock.Text = "Non-Stock"
        '
        'chOnPromotion
        '
        Me.chOnPromotion.AutoSize = True
        Me.chOnPromotion.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.chOnPromotion.Location = New System.Drawing.Point(86, 20)
        Me.chOnPromotion.Name = "chOnPromotion"
        Me.chOnPromotion.Size = New System.Drawing.Size(113, 22)
        Me.chOnPromotion.TabIndex = 16
        Me.chOnPromotion.Text = "On Promotion"
        Me.chOnPromotion.Visible = False
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.BackColor = System.Drawing.Color.Transparent
        Me.Label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label1.Location = New System.Drawing.Point(132, 18)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(91, 18)
        Me.Label1.TabIndex = 20
        Me.Label1.Text = "Product Code"
        '
        'tbProdCode
        '
        Me.tbProdCode.BackColor = System.Drawing.Color.White
        Me.tbProdCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbProdCode.Location = New System.Drawing.Point(137, 63)
        Me.tbProdCode.Name = "tbProdCode"
        Me.tbProdCode.Size = New System.Drawing.Size(161, 26)
        Me.tbProdCode.TabIndex = 21
        '
        'tbManuf
        '
        Me.tbManuf.BackColor = System.Drawing.Color.White
        Me.tbManuf.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbManuf.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
        Me.tbManuf.Location = New System.Drawing.Point(16, 63)
        Me.tbManuf.Name = "tbManuf"
        Me.tbManuf.Size = New System.Drawing.Size(115, 26)
        Me.tbManuf.TabIndex = 2
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.BackColor = System.Drawing.Color.Transparent
        Me.Label2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label2.Location = New System.Drawing.Point(12, 18)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(116, 18)
        Me.Label2.TabIndex = 24
        Me.Label2.Text = "Manuf.Prod.Code"
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.BackColor = System.Drawing.Color.Transparent
        Me.Label3.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label3.Location = New System.Drawing.Point(338, 70)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(69, 18)
        Me.Label3.TabIndex = 25
        Me.Label3.Text = "Bar Codes"
        '
        'Label4
        '
        Me.Label4.AutoSize = True
        Me.Label4.BackColor = System.Drawing.Color.Transparent
        Me.Label4.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label4.Location = New System.Drawing.Point(300, 18)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(149, 18)
        Me.Label4.TabIndex = 27
        Me.Label4.Text = "Short Description (Eng)"
        '
        'tbShortDescE
        '
        Me.tbShortDescE.BackColor = System.Drawing.Color.White
        Me.tbShortDescE.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbShortDescE.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
        Me.tbShortDescE.Location = New System.Drawing.Point(304, 63)
        Me.tbShortDescE.Name = "tbShortDescE"
        Me.tbShortDescE.Size = New System.Drawing.Size(193, 26)
        Me.tbShortDescE.TabIndex = 4
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        Me.Label5.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label5.Location = New System.Drawing.Point(194, 79)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(149, 18)
        Me.Label5.TabIndex = 29
        Me.Label5.Text = "Short Description (Arb)"
        Me.Label5.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'tbShortDescA
        '
        Me.tbShortDescA.BackColor = System.Drawing.Color.AliceBlue
        Me.tbShortDescA.Location = New System.Drawing.Point(137, 98)
        Me.tbShortDescA.Name = "tbShortDescA"
        Me.tbShortDescA.Size = New System.Drawing.Size(198, 26)
        Me.tbShortDescA.TabIndex = 12
        Me.tbShortDescA.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label6
        '
        Me.Label6.AutoSize = True
        Me.Label6.BackColor = System.Drawing.Color.Transparent
        Me.Label6.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label6.Location = New System.Drawing.Point(12, 70)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(145, 18)
        Me.Label6.TabIndex = 31
        Me.Label6.Text = "Long Description (Eng)"
        '
        'tbLongDescE
        '
        Me.tbLongDescE.BackColor = System.Drawing.Color.White
        Me.tbLongDescE.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbLongDescE.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
        Me.tbLongDescE.Location = New System.Drawing.Point(16, 116)
        Me.tbLongDescE.Name = "tbLongDescE"
        Me.tbLongDescE.Size = New System.Drawing.Size(313, 26)
        Me.tbLongDescE.TabIndex = 13
        '
        'tbLongDescA
        '
        Me.tbLongDescA.BackColor = System.Drawing.Color.AliceBlue
        Me.tbLongDescA.Location = New System.Drawing.Point(26, 142)
        Me.tbLongDescA.Name = "tbLongDescA"
        Me.tbLongDescA.Size = New System.Drawing.Size(309, 26)
        Me.tbLongDescA.TabIndex = 14
        Me.tbLongDescA.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label7
        '
        Me.Label7.AutoSize = True
        Me.Label7.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label7.Location = New System.Drawing.Point(195, 124)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(145, 18)
        Me.Label7.TabIndex = 33
        Me.Label7.Text = "Long Description (Arb)"
        Me.Label7.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'tbPrice1
        '
        Me.tbPrice1.BackColor = System.Drawing.Color.White
        Me.tbPrice1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbPrice1.Location = New System.Drawing.Point(470, 285)
        Me.tbPrice1.Name = "tbPrice1"
        Me.tbPrice1.Size = New System.Drawing.Size(69, 26)
        Me.tbPrice1.TabIndex = 7
        Me.tbPrice1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label8
        '
        Me.Label8.AutoSize = True
        Me.Label8.BackColor = System.Drawing.Color.Transparent
        Me.Label8.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label8.Location = New System.Drawing.Point(467, 240)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(49, 18)
        Me.Label8.TabIndex = 34
        Me.Label8.Text = "Price 1"
        '
        'tbPrice2
        '
        Me.tbPrice2.BackColor = System.Drawing.Color.White
        Me.tbPrice2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbPrice2.Location = New System.Drawing.Point(544, 285)
        Me.tbPrice2.Name = "tbPrice2"
        Me.tbPrice2.Size = New System.Drawing.Size(69, 26)
        Me.tbPrice2.TabIndex = 20
        Me.tbPrice2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label9
        '
        Me.Label9.AutoSize = True
        Me.Label9.BackColor = System.Drawing.Color.Transparent
        Me.Label9.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label9.Location = New System.Drawing.Point(539, 240)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(49, 18)
        Me.Label9.TabIndex = 36
        Me.Label9.Text = "Price 2"
        '
        'tbPrice3
        '
        Me.tbPrice3.BackColor = System.Drawing.Color.White
        Me.tbPrice3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbPrice3.Location = New System.Drawing.Point(618, 286)
        Me.tbPrice3.Name = "tbPrice3"
        Me.tbPrice3.Size = New System.Drawing.Size(69, 26)
        Me.tbPrice3.TabIndex = 21
        Me.tbPrice3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label10
        '
        Me.Label10.AutoSize = True
        Me.Label10.BackColor = System.Drawing.Color.Transparent
        Me.Label10.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label10.Location = New System.Drawing.Point(612, 240)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(49, 18)
        Me.Label10.TabIndex = 38
        Me.Label10.Text = "Price 3"
        '
        'tbMarkup3
        '
        Me.tbMarkup3.BackColor = System.Drawing.Color.White
        Me.tbMarkup3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbMarkup3.Location = New System.Drawing.Point(508, 161)
        Me.tbMarkup3.Name = "tbMarkup3"
        Me.tbMarkup3.Size = New System.Drawing.Size(66, 26)
        Me.tbMarkup3.TabIndex = 26
        Me.tbMarkup3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label11
        '
        Me.Label11.AutoSize = True
        Me.Label11.BackColor = System.Drawing.Color.Transparent
        Me.Label11.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label11.Location = New System.Drawing.Point(504, 117)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(69, 18)
        Me.Label11.TabIndex = 44
        Me.Label11.Text = "Markup %"
        '
        'tbMarkup2
        '
        Me.tbMarkup2.BackColor = System.Drawing.Color.White
        Me.tbMarkup2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbMarkup2.Location = New System.Drawing.Point(582, 113)
        Me.tbMarkup2.Name = "tbMarkup2"
        Me.tbMarkup2.Size = New System.Drawing.Size(66, 26)
        Me.tbMarkup2.TabIndex = 25
        Me.tbMarkup2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label12
        '
        Me.Label12.AutoSize = True
        Me.Label12.BackColor = System.Drawing.Color.Transparent
        Me.Label12.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label12.Location = New System.Drawing.Point(576, 70)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(69, 18)
        Me.Label12.TabIndex = 42
        Me.Label12.Text = "Markup %"
        '
        'tbMarkup1
        '
        Me.tbMarkup1.BackColor = System.Drawing.Color.White
        Me.tbMarkup1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbMarkup1.Location = New System.Drawing.Point(508, 113)
        Me.tbMarkup1.Name = "tbMarkup1"
        Me.tbMarkup1.Size = New System.Drawing.Size(66, 26)
        Me.tbMarkup1.TabIndex = 24
        Me.tbMarkup1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label13
        '
        Me.Label13.AutoSize = True
        Me.Label13.BackColor = System.Drawing.Color.Transparent
        Me.Label13.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label13.Location = New System.Drawing.Point(502, 70)
        Me.Label13.Name = "Label13"
        Me.Label13.Size = New System.Drawing.Size(69, 18)
        Me.Label13.TabIndex = 40
        Me.Label13.Text = "Markup %"
        '
        'tbROL
        '
        Me.tbROL.BackColor = System.Drawing.Color.AliceBlue
        Me.tbROL.Location = New System.Drawing.Point(282, 33)
        Me.tbROL.Name = "tbROL"
        Me.tbROL.Size = New System.Drawing.Size(66, 26)
        Me.tbROL.TabIndex = 27
        Me.tbROL.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.tbROL.Visible = False
        '
        'Label14
        '
        Me.Label14.AutoSize = True
        Me.Label14.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label14.Location = New System.Drawing.Point(283, 17)
        Me.Label14.Name = "Label14"
        Me.Label14.Size = New System.Drawing.Size(57, 18)
        Me.Label14.TabIndex = 46
        Me.Label14.Text = "ROL Qty"
        Me.Label14.Visible = False
        '
        'chKit
        '
        Me.chKit.AutoSize = True
        Me.chKit.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.chKit.Location = New System.Drawing.Point(245, 21)
        Me.chKit.Name = "chKit"
        Me.chKit.Size = New System.Drawing.Size(44, 22)
        Me.chKit.TabIndex = 17
        Me.chKit.Text = "Kit"
        Me.chKit.Visible = False
        '
        'tbImageFile
        '
        Me.tbImageFile.BackColor = System.Drawing.Color.AliceBlue
        Me.tbImageFile.Location = New System.Drawing.Point(305, 61)
        Me.tbImageFile.Name = "tbImageFile"
        Me.tbImageFile.Size = New System.Drawing.Size(119, 26)
        Me.tbImageFile.TabIndex = 23
        '
        'Label15
        '
        Me.Label15.AutoSize = True
        Me.Label15.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label15.Location = New System.Drawing.Point(302, 44)
        Me.Label15.Name = "Label15"
        Me.Label15.Size = New System.Drawing.Size(111, 18)
        Me.Label15.TabIndex = 51
        Me.Label15.Text = "Image File Path.."
        '
        'btnImage
        '
        Me.btnImage.BackColor = System.Drawing.Color.SteelBlue
        Me.btnImage.Image = CType(resources.GetObject("btnImage.Image"), System.Drawing.Image)
        Me.btnImage.Location = New System.Drawing.Point(430, 65)
        Me.btnImage.Name = "btnImage"
        Me.btnImage.Size = New System.Drawing.Size(27, 20)
        Me.btnImage.TabIndex = 52
        Me.btnImage.UseVisualStyleBackColor = False
        '
        'dgShowroom
        '
        Me.dgShowroom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.dgShowroom.CaptionVisible = False
        Me.dgShowroom.DataMember = ""
        Me.dgShowroom.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgShowroom.Location = New System.Drawing.Point(244, 350)
        Me.dgShowroom.Name = "dgShowroom"
        Me.dgShowroom.RowHeadersVisible = False
        Me.dgShowroom.Size = New System.Drawing.Size(244, 104)
        Me.dgShowroom.TabIndex = 33
        '
        'Label16
        '
        Me.Label16.AutoSize = True
        Me.Label16.BackColor = System.Drawing.Color.Transparent
        Me.Label16.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label16.Location = New System.Drawing.Point(238, 304)
        Me.Label16.Name = "Label16"
        Me.Label16.Size = New System.Drawing.Size(169, 18)
        Me.Label16.TabIndex = 54
        Me.Label16.Text = "Showrooms Minimum Qty"
        '
        'Label17
        '
        Me.Label17.AutoSize = True
        Me.Label17.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label17.Location = New System.Drawing.Point(335, 14)
        Me.Label17.Name = "Label17"
        Me.Label17.Size = New System.Drawing.Size(103, 18)
        Me.Label17.TabIndex = 55
        Me.Label17.Text = "Outer Pack Size"
        Me.Label17.Visible = False
        '
        'Label18
        '
        Me.Label18.AutoSize = True
        Me.Label18.BackColor = System.Drawing.Color.Transparent
        Me.Label18.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label18.Location = New System.Drawing.Point(611, 15)
        Me.Label18.Name = "Label18"
        Me.Label18.Size = New System.Drawing.Size(87, 18)
        Me.Label18.TabIndex = 56
        Me.Label18.Text = "Pack Volume"
        '
        'Label19
        '
        Me.Label19.AutoSize = True
        Me.Label19.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label19.Location = New System.Drawing.Point(94, 41)
        Me.Label19.Name = "Label19"
        Me.Label19.Size = New System.Drawing.Size(71, 18)
        Me.Label19.TabIndex = 57
        Me.Label19.Text = "Lead Time"
        Me.Label19.Visible = False
        '
        'tbOuterPack
        '
        Me.tbOuterPack.BackColor = System.Drawing.Color.AliceBlue
        Me.tbOuterPack.Location = New System.Drawing.Point(357, 34)
        Me.tbOuterPack.Name = "tbOuterPack"
        Me.tbOuterPack.Size = New System.Drawing.Size(62, 26)
        Me.tbOuterPack.TabIndex = 30
        Me.tbOuterPack.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.tbOuterPack.Visible = False
        '
        'tbLeadTime
        '
        Me.tbLeadTime.BackColor = System.Drawing.Color.AliceBlue
        Me.tbLeadTime.Location = New System.Drawing.Point(429, 18)
        Me.tbLeadTime.Name = "tbLeadTime"
        Me.tbLeadTime.Size = New System.Drawing.Size(51, 26)
        Me.tbLeadTime.TabIndex = 28
        Me.tbLeadTime.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.tbLeadTime.Visible = False
        '
        'Label20
        '
        Me.Label20.AutoSize = True
        Me.Label20.BackColor = System.Drawing.Color.Transparent
        Me.Label20.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label20.Location = New System.Drawing.Point(498, 15)
        Me.Label20.Name = "Label20"
        Me.Label20.Size = New System.Drawing.Size(63, 18)
        Me.Label20.TabIndex = 61
        Me.Label20.Text = "Sale Unit"
        '
        'chActive
        '
        Me.chActive.AutoSize = True
        Me.chActive.Checked = True
        Me.chActive.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chActive.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.chActive.Location = New System.Drawing.Point(188, 24)
        Me.chActive.Name = "chActive"
        Me.chActive.Size = New System.Drawing.Size(65, 22)
        Me.chActive.TabIndex = 15
        Me.chActive.Text = "Active"
        Me.chActive.Visible = False
        '
        'cmbLead
        '
        Me.cmbLead.BackColor = System.Drawing.Color.AliceBlue
        Me.cmbLead.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbLead.Items.AddRange(New Object() {"DAYS", "MONTHS"})
        Me.cmbLead.Location = New System.Drawing.Point(429, 41)
        Me.cmbLead.Name = "cmbLead"
        Me.cmbLead.Size = New System.Drawing.Size(76, 26)
        Me.cmbLead.TabIndex = 29
        Me.cmbLead.Visible = False
        '
        'chWhProduct
        '
        Me.chWhProduct.AutoSize = True
        Me.chWhProduct.Checked = True
        Me.chWhProduct.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chWhProduct.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.chWhProduct.Location = New System.Drawing.Point(188, 38)
        Me.chWhProduct.Name = "chWhProduct"
        Me.chWhProduct.Size = New System.Drawing.Size(100, 22)
        Me.chWhProduct.TabIndex = 11
        Me.chWhProduct.Text = "WH Product"
        Me.chWhProduct.Visible = False
        '
        'Label22
        '
        Me.Label22.AutoSize = True
        Me.Label22.BackColor = System.Drawing.Color.Transparent
        Me.Label22.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label22.Location = New System.Drawing.Point(239, 183)
        Me.Label22.Name = "Label22"
        Me.Label22.Size = New System.Drawing.Size(87, 18)
        Me.Label22.TabIndex = 69
        Me.Label22.Text = "Manufacture"
        '
        'pbImage
        '
        Me.pbImage.BackColor = System.Drawing.Color.LightSlateGray
        Me.pbImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.pbImage.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.pbImage.Location = New System.Drawing.Point(348, 466)
        Me.pbImage.Name = "pbImage"
        Me.pbImage.Size = New System.Drawing.Size(140, 101)
        Me.pbImage.TabIndex = 49
        Me.pbImage.TabStop = False
        '
        'GroupBox1
        '
        Me.GroupBox1.BackColor = System.Drawing.Color.Transparent
        Me.GroupBox1.Controls.Add(Me.rbStock)
        Me.GroupBox1.Controls.Add(Me.rbSample)
        Me.GroupBox1.Controls.Add(Me.rbNonStock)
        Me.GroupBox1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.GroupBox1.Location = New System.Drawing.Point(241, 436)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(101, 107)
        Me.GroupBox1.TabIndex = 70
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "Item Type"
        '
        'dgBarcode
        '
        Me.dgBarcode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.dgBarcode.CaptionVisible = False
        Me.dgBarcode.ColumnHeadersVisible = False
        Me.dgBarcode.DataMember = ""
        Me.dgBarcode.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgBarcode.Location = New System.Drawing.Point(341, 113)
        Me.dgBarcode.Name = "dgBarcode"
        Me.dgBarcode.RowHeadersVisible = False
        Me.dgBarcode.Size = New System.Drawing.Size(156, 74)
        Me.dgBarcode.TabIndex = 133
        Me.ttHelp.SetToolTip(Me.dgBarcode, "Scan ONE barcode per line")
        '
        'Label21
        '
        Me.Label21.AutoSize = True
        Me.Label21.BackColor = System.Drawing.Color.Transparent
        Me.Label21.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label21.Location = New System.Drawing.Point(12, 304)
        Me.Label21.Name = "Label21"
        Me.Label21.Size = New System.Drawing.Size(159, 18)
        Me.Label21.TabIndex = 72
        Me.Label21.Text = "Suppliers of this product"
        '
        'dgSuppliers
        '
        Me.dgSuppliers.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.dgSuppliers.CaptionVisible = False
        Me.dgSuppliers.DataMember = ""
        Me.dgSuppliers.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgSuppliers.Location = New System.Drawing.Point(16, 350)
        Me.dgSuppliers.Name = "dgSuppliers"
        Me.dgSuppliers.RowHeadersVisible = False
        Me.dgSuppliers.Size = New System.Drawing.Size(214, 268)
        Me.dgSuppliers.TabIndex = 8
        '
        'cmbGroup7
        '
        Me.cmbGroup7.BackColor = System.Drawing.Color.AliceBlue
        Me.cmbGroup7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbGroup7.Location = New System.Drawing.Point(160, 62)
        Me.cmbGroup7.Name = "cmbGroup7"
        Me.cmbGroup7.Size = New System.Drawing.Size(139, 26)
        Me.cmbGroup7.TabIndex = 135
        Me.cmbGroup7.Visible = False
        '
        'GroupBox2
        '
        Me.GroupBox2.BackColor = System.Drawing.Color.Transparent
        Me.GroupBox2.Controls.Add(Me.rbPCI)
        Me.GroupBox2.Controls.Add(Me.rbActiveProd)
        Me.GroupBox2.Controls.Add(Me.rbTempDisc)
        Me.GroupBox2.Controls.Add(Me.rbNIOH)
        Me.GroupBox2.Controls.Add(Me.rbRangedOut)
        Me.GroupBox2.Controls.Add(Me.rbToBePurged)
        Me.GroupBox2.Location = New System.Drawing.Point(498, 304)
        Me.GroupBox2.Name = "GroupBox2"
        Me.GroupBox2.Size = New System.Drawing.Size(186, 191)
        Me.GroupBox2.TabIndex = 136
        Me.GroupBox2.TabStop = False
        Me.GroupBox2.Text = "Product Indicator"
        '
        'rbPCI
        '
        Me.rbPCI.AutoSize = True
        Me.rbPCI.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbPCI.Location = New System.Drawing.Point(17, 158)
        Me.rbPCI.Name = "rbPCI"
        Me.rbPCI.Size = New System.Drawing.Size(126, 22)
        Me.rbPCI.TabIndex = 6
        Me.rbPCI.TabStop = True
        Me.rbPCI.Text = "Catalogue Items"
        '
        'rbActiveProd
        '
        Me.rbActiveProd.AutoSize = True
        Me.rbActiveProd.Checked = True
        Me.rbActiveProd.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbActiveProd.Location = New System.Drawing.Point(17, 23)
        Me.rbActiveProd.Name = "rbActiveProd"
        Me.rbActiveProd.Size = New System.Drawing.Size(115, 22)
        Me.rbActiveProd.TabIndex = 0
        Me.rbActiveProd.TabStop = True
        Me.rbActiveProd.Text = "Active Product"
        '
        'rbTempDisc
        '
        Me.rbTempDisc.AutoSize = True
        Me.rbTempDisc.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbTempDisc.Location = New System.Drawing.Point(17, 50)
        Me.rbTempDisc.Name = "rbTempDisc"
        Me.rbTempDisc.Size = New System.Drawing.Size(93, 22)
        Me.rbTempDisc.TabIndex = 1
        Me.rbTempDisc.Text = "Temp.Desc"
        '
        'rbNIOH
        '
        Me.rbNIOH.AutoSize = True
        Me.rbNIOH.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbNIOH.Location = New System.Drawing.Point(17, 130)
        Me.rbNIOH.Name = "rbNIOH"
        Me.rbNIOH.Size = New System.Drawing.Size(140, 22)
        Me.rbNIOH.TabIndex = 5
        Me.rbNIOH.Text = "New Item On Hold"
        '
        'rbRangedOut
        '
        Me.rbRangedOut.AutoSize = True
        Me.rbRangedOut.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbRangedOut.Location = New System.Drawing.Point(17, 76)
        Me.rbRangedOut.Name = "rbRangedOut"
        Me.rbRangedOut.Size = New System.Drawing.Size(87, 22)
        Me.rbRangedOut.TabIndex = 2
        Me.rbRangedOut.Text = "RangeOut"
        '
        'rbToBePurged
        '
        Me.rbToBePurged.AutoSize = True
        Me.rbToBePurged.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbToBePurged.Location = New System.Drawing.Point(17, 103)
        Me.rbToBePurged.Name = "rbToBePurged"
        Me.rbToBePurged.Size = New System.Drawing.Size(106, 22)
        Me.rbToBePurged.TabIndex = 3
        Me.rbToBePurged.Text = "To Be Purged"
        '
        'CmbGroup8
        '
        Me.CmbGroup8.BackColor = System.Drawing.Color.AliceBlue
        Me.CmbGroup8.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.CmbGroup8.Location = New System.Drawing.Point(43, 61)
        Me.CmbGroup8.Name = "CmbGroup8"
        Me.CmbGroup8.Size = New System.Drawing.Size(111, 26)
        Me.CmbGroup8.TabIndex = 137
        Me.CmbGroup8.Visible = False
        '
        'GroupBox3
        '
        Me.GroupBox3.BackColor = System.Drawing.Color.Transparent
        Me.GroupBox3.Controls.Add(Me.cmdFilter)
        Me.GroupBox3.Controls.Add(Me.Label24)
        Me.GroupBox3.Controls.Add(Me.dgProduct)
        Me.GroupBox3.Controls.Add(Me.cmbPOfilter)
        Me.GroupBox3.Controls.Add(Me.tbLongDescA)
        Me.GroupBox3.Controls.Add(Me.Label5)
        Me.GroupBox3.Controls.Add(Me.Label7)
        Me.GroupBox3.Controls.Add(Me.tbShortDescA)
        Me.GroupBox3.Location = New System.Drawing.Point(717, 19)
        Me.GroupBox3.Name = "GroupBox3"
        Me.GroupBox3.Size = New System.Drawing.Size(375, 570)
        Me.GroupBox3.TabIndex = 139
        Me.GroupBox3.TabStop = False
        '
        'cmdFilter
        '
        Me.cmdFilter.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdFilter.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdFilter.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdFilter.Location = New System.Drawing.Point(294, 533)
        Me.cmdFilter.Name = "cmdFilter"
        Me.cmdFilter.Size = New System.Drawing.Size(75, 27)
        Me.cmdFilter.TabIndex = 292
        Me.cmdFilter.Text = "Filter"
        '
        'Label24
        '
        Me.Label24.AutoSize = True
        Me.Label24.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label24.Location = New System.Drawing.Point(8, 537)
        Me.Label24.Name = "Label24"
        Me.Label24.Size = New System.Drawing.Size(80, 18)
        Me.Label24.TabIndex = 141
        Me.Label24.Text = "Filter By PO"
        '
        'dgProduct
        '
        Me.dgProduct.BackColor = System.Drawing.Color.AliceBlue
        Me.dgProduct.BackgroundColor = System.Drawing.Color.AliceBlue
        Me.dgProduct.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.dgProduct.CaptionVisible = False
        Me.dgProduct.DataMember = ""
        Me.dgProduct.HeaderBackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(128, Byte), Integer))
        Me.dgProduct.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgProduct.Location = New System.Drawing.Point(6, 15)
        Me.dgProduct.Name = "dgProduct"
        Me.dgProduct.ReadOnly = True
        Me.dgProduct.Size = New System.Drawing.Size(363, 512)
        Me.dgProduct.TabIndex = 140
        '
        'cmbPOfilter
        '
        Me.cmbPOfilter.DisplayMember = "Text"
        Me.cmbPOfilter.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbPOfilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbPOfilter.ItemHeight = 19
        Me.cmbPOfilter.Location = New System.Drawing.Point(91, 534)
        Me.cmbPOfilter.Name = "cmbPOfilter"
        Me.cmbPOfilter.Size = New System.Drawing.Size(197, 25)
        Me.cmbPOfilter.TabIndex = 146
        '
        'Label23
        '
        Me.Label23.AutoSize = True
        Me.Label23.BackColor = System.Drawing.Color.Transparent
        Me.Label23.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label23.Location = New System.Drawing.Point(719, -2)
        Me.Label23.Name = "Label23"
        Me.Label23.Size = New System.Drawing.Size(88, 18)
        Me.Label23.TabIndex = 140
        Me.Label23.Text = "ProductCode"
        '
        'TextBox1
        '
        Me.TextBox1.BackColor = System.Drawing.Color.White
        Me.TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox1.Location = New System.Drawing.Point(813, 21)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(204, 26)
        Me.TextBox1.TabIndex = 141
        '
        'GroupBox4
        '
        Me.GroupBox4.Controls.Add(Me.chOnPromotion)
        Me.GroupBox4.Controls.Add(Me.Label19)
        Me.GroupBox4.Controls.Add(Me.chActive)
        Me.GroupBox4.Controls.Add(Me.chWhProduct)
        Me.GroupBox4.Controls.Add(Me.CmbGroup8)
        Me.GroupBox4.Controls.Add(Me.cmbGroup7)
        Me.GroupBox4.Controls.Add(Me.chKit)
        Me.GroupBox4.Controls.Add(Me.tbROL)
        Me.GroupBox4.Controls.Add(Me.Label14)
        Me.GroupBox4.Controls.Add(Me.tbOuterPack)
        Me.GroupBox4.Controls.Add(Me.Label17)
        Me.GroupBox4.Controls.Add(Me.cmbLead)
        Me.GroupBox4.Controls.Add(Me.tbLeadTime)
        Me.GroupBox4.Controls.Add(Me.tbImageFile)
        Me.GroupBox4.Controls.Add(Me.Label15)
        Me.GroupBox4.Controls.Add(Me.btnImage)
        Me.GroupBox4.Location = New System.Drawing.Point(705, 347)
        Me.GroupBox4.Name = "GroupBox4"
        Me.GroupBox4.Size = New System.Drawing.Size(301, 91)
        Me.GroupBox4.TabIndex = 143
        Me.GroupBox4.TabStop = False
        Me.GroupBox4.Visible = False
        '
        'Label25
        '
        Me.Label25.AutoSize = True
        Me.Label25.BackColor = System.Drawing.Color.Transparent
        Me.Label25.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label25.Location = New System.Drawing.Point(10, 129)
        Me.Label25.Name = "Label25"
        Me.Label25.Size = New System.Drawing.Size(83, 18)
        Me.Label25.TabIndex = 69
        Me.Label25.Text = "Department"
        '
        'Label26
        '
        Me.Label26.AutoSize = True
        Me.Label26.BackColor = System.Drawing.Color.Transparent
        Me.Label26.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label26.Location = New System.Drawing.Point(11, 242)
        Me.Label26.Name = "Label26"
        Me.Label26.Size = New System.Drawing.Size(89, 18)
        Me.Label26.TabIndex = 69
        Me.Label26.Text = "Sub Category"
        '
        'Label27
        '
        Me.Label27.AutoSize = True
        Me.Label27.BackColor = System.Drawing.Color.Transparent
        Me.Label27.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label27.Location = New System.Drawing.Point(242, 241)
        Me.Label27.Name = "Label27"
        Me.Label27.Size = New System.Drawing.Size(115, 18)
        Me.Label27.TabIndex = 69
        Me.Label27.Text = "Sub Sub Category"
        '
        'Label28
        '
        Me.Label28.AutoSize = True
        Me.Label28.BackColor = System.Drawing.Color.Transparent
        Me.Label28.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label28.Location = New System.Drawing.Point(13, 184)
        Me.Label28.Name = "Label28"
        Me.Label28.Size = New System.Drawing.Size(44, 18)
        Me.Label28.TabIndex = 69
        Me.Label28.Text = "Brand"
        '
        'Label29
        '
        Me.Label29.AutoSize = True
        Me.Label29.BackColor = System.Drawing.Color.Transparent
        Me.Label29.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label29.Location = New System.Drawing.Point(464, 183)
        Me.Label29.Name = "Label29"
        Me.Label29.Size = New System.Drawing.Size(63, 18)
        Me.Label29.TabIndex = 69
        Me.Label29.Text = "Category"
        '
        'dtpLPD
        '
        Me.dtpLPD.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
        Me.dtpLPD.Location = New System.Drawing.Point(347, 586)
        Me.dtpLPD.Name = "dtpLPD"
        Me.dtpLPD.Size = New System.Drawing.Size(107, 26)
        Me.dtpLPD.TabIndex = 144
        '
        'chkLPD
        '
        Me.chkLPD.AutoSize = True
        Me.chkLPD.BackColor = System.Drawing.Color.Transparent
        Me.chkLPD.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.chkLPD.Location = New System.Drawing.Point(238, 564)
        Me.chkLPD.Name = "chkLPD"
        Me.chkLPD.Size = New System.Drawing.Size(106, 22)
        Me.chkLPD.TabIndex = 145
        Me.chkLPD.Text = "Last Pur.Date"
        Me.chkLPD.UseVisualStyleBackColor = False
        '
        'cmbDepartment
        '
        Me.cmbDepartment.DisplayMember = "Text"
        Me.cmbDepartment.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbDepartment.ItemHeight = 19
        Me.cmbDepartment.Location = New System.Drawing.Point(15, 176)
        Me.cmbDepartment.Name = "cmbDepartment"
        Me.cmbDepartment.Size = New System.Drawing.Size(220, 25)
        Me.cmbDepartment.TabIndex = 146
        '
        'cmbBrand
        '
        Me.cmbBrand.DisplayMember = "Text"
        Me.cmbBrand.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbBrand.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbBrand.ItemHeight = 19
        Me.cmbBrand.Location = New System.Drawing.Point(15, 230)
        Me.cmbBrand.Name = "cmbBrand"
        Me.cmbBrand.Size = New System.Drawing.Size(220, 25)
        Me.cmbBrand.TabIndex = 146
        '
        'cmbSubCat
        '
        Me.cmbSubCat.DisplayMember = "Text"
        Me.cmbSubCat.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbSubCat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbSubCat.ItemHeight = 19
        Me.cmbSubCat.Location = New System.Drawing.Point(15, 289)
        Me.cmbSubCat.Name = "cmbSubCat"
        Me.cmbSubCat.Size = New System.Drawing.Size(220, 25)
        Me.cmbSubCat.TabIndex = 146
        '
        'cmbManuf
        '
        Me.cmbManuf.DisplayMember = "Text"
        Me.cmbManuf.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbManuf.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbManuf.ItemHeight = 19
        Me.cmbManuf.Location = New System.Drawing.Point(241, 230)
        Me.cmbManuf.Name = "cmbManuf"
        Me.cmbManuf.Size = New System.Drawing.Size(219, 25)
        Me.cmbManuf.TabIndex = 146
        '
        'cmbSubSubCat
        '
        Me.cmbSubSubCat.DisplayMember = "Text"
        Me.cmbSubSubCat.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbSubSubCat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbSubSubCat.ItemHeight = 19
        Me.cmbSubSubCat.Location = New System.Drawing.Point(241, 289)
        Me.cmbSubSubCat.Name = "cmbSubSubCat"
        Me.cmbSubSubCat.Size = New System.Drawing.Size(219, 25)
        Me.cmbSubSubCat.TabIndex = 146
        '
        'cmbCategory
        '
        Me.cmbCategory.DisplayMember = "Text"
        Me.cmbCategory.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbCategory.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbCategory.ItemHeight = 19
        Me.cmbCategory.Location = New System.Drawing.Point(466, 230)
        Me.cmbCategory.Name = "cmbCategory"
        Me.cmbCategory.Size = New System.Drawing.Size(221, 25)
        Me.cmbCategory.TabIndex = 146
        '
        'cmbUnit
        '
        Me.cmbUnit.DisplayMember = "Text"
        Me.cmbUnit.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbUnit.ItemHeight = 19
        Me.cmbUnit.Location = New System.Drawing.Point(503, 62)
        Me.cmbUnit.Name = "cmbUnit"
        Me.cmbUnit.Size = New System.Drawing.Size(105, 25)
        Me.cmbUnit.TabIndex = 146
        '
        'cmbPack
        '
        Me.cmbPack.DisplayMember = "Text"
        Me.cmbPack.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbPack.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbPack.ItemHeight = 19
        Me.cmbPack.Location = New System.Drawing.Point(614, 63)
        Me.cmbPack.Name = "cmbPack"
        Me.cmbPack.Size = New System.Drawing.Size(105, 25)
        Me.cmbPack.TabIndex = 146
        '
        'cmdSave
        '
        Me.cmdSave.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdSave.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdSave.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdSave.Location = New System.Drawing.Point(928, 624)
        Me.cmdSave.Name = "cmdSave"
        Me.cmdSave.Size = New System.Drawing.Size(82, 27)
        Me.cmdSave.TabIndex = 292
        Me.cmdSave.Text = "Save"
        '
        'cmdExit
        '
        Me.cmdExit.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdExit.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdExit.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdExit.Location = New System.Drawing.Point(1015, 624)
        Me.cmdExit.Name = "cmdExit"
        Me.cmdExit.Size = New System.Drawing.Size(80, 27)
        Me.cmdExit.TabIndex = 291
        Me.cmdExit.Text = "Exit"
        '
        'cmdOpen
        '
        Me.cmdOpen.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdOpen.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdOpen.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdOpen.Location = New System.Drawing.Point(840, 625)
        Me.cmdOpen.Name = "cmdOpen"
        Me.cmdOpen.Size = New System.Drawing.Size(82, 27)
        Me.cmdOpen.TabIndex = 292
        Me.cmdOpen.Text = "Open"
        '
        'cmdDisplay
        '
        Me.cmdDisplay.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdDisplay.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdDisplay.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdDisplay.Location = New System.Drawing.Point(1023, 20)
        Me.cmdDisplay.Name = "cmdDisplay"
        Me.cmdDisplay.Size = New System.Drawing.Size(68, 27)
        Me.cmdDisplay.TabIndex = 293
        Me.cmdDisplay.Text = "Display"
        '
        'GroupPanel1
        '
        Me.GroupPanel1.CanvasColor = System.Drawing.SystemColors.Control
        Me.GroupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007
        Me.GroupPanel1.Controls.Add(Me.Label9)
        Me.GroupPanel1.Controls.Add(Me.Label1)
        Me.GroupPanel1.Controls.Add(Me.Label2)
        Me.GroupPanel1.Controls.Add(Me.Label3)
        Me.GroupPanel1.Controls.Add(Me.Label4)
        Me.GroupPanel1.Controls.Add(Me.Label6)
        Me.GroupPanel1.Controls.Add(Me.Label8)
        Me.GroupPanel1.Controls.Add(Me.Label10)
        Me.GroupPanel1.Controls.Add(Me.Label13)
        Me.GroupPanel1.Controls.Add(Me.Label12)
        Me.GroupPanel1.Controls.Add(Me.Label11)
        Me.GroupPanel1.Controls.Add(Me.Label16)
        Me.GroupPanel1.Controls.Add(Me.Label20)
        Me.GroupPanel1.Controls.Add(Me.GroupBox1)
        Me.GroupPanel1.Controls.Add(Me.GroupBox2)
        Me.GroupPanel1.Controls.Add(Me.chkLPD)
        Me.GroupPanel1.Controls.Add(Me.Label22)
        Me.GroupPanel1.Controls.Add(Me.Label25)
        Me.GroupPanel1.Controls.Add(Me.Label26)
        Me.GroupPanel1.Controls.Add(Me.Label18)
        Me.GroupPanel1.Controls.Add(Me.Label29)
        Me.GroupPanel1.Controls.Add(Me.Label28)
        Me.GroupPanel1.Controls.Add(Me.Label21)
        Me.GroupPanel1.Controls.Add(Me.Label23)
        Me.GroupPanel1.Controls.Add(Me.Label27)
        Me.GroupPanel1.Controls.Add(Me.GroupBox3)
        Me.GroupPanel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.GroupPanel1.Location = New System.Drawing.Point(0, 0)
        Me.GroupPanel1.Name = "GroupPanel1"
        Me.GroupPanel1.Size = New System.Drawing.Size(1107, 667)
        '
        '
        '
        Me.GroupPanel1.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2
        Me.GroupPanel1.Style.BackColorGradientAngle = 90
        Me.GroupPanel1.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground
        Me.GroupPanel1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderBottomWidth = 1
        Me.GroupPanel1.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder
        Me.GroupPanel1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderLeftWidth = 1
        Me.GroupPanel1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderRightWidth = 1
        Me.GroupPanel1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderTopWidth = 1
        Me.GroupPanel1.Style.CornerDiameter = 4
        Me.GroupPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded
        Me.GroupPanel1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center
        Me.GroupPanel1.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText
        Me.GroupPanel1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near
        Me.GroupPanel1.TabIndex = 294
        Me.GroupPanel1.Text = "Product Master - Add"
        '
        'frmProductMasterAdd
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
        Me.BackColor = System.Drawing.SystemColors.ActiveCaption
        Me.ClientSize = New System.Drawing.Size(1107, 667)
        Me.ControlBox = False
        Me.Controls.Add(Me.cmdDisplay)
        Me.Controls.Add(Me.cmdOpen)
        Me.Controls.Add(Me.cmdSave)
        Me.Controls.Add(Me.cmdExit)
        Me.Controls.Add(Me.cmbSubSubCat)
        Me.Controls.Add(Me.cmbPack)
        Me.Controls.Add(Me.cmbUnit)
        Me.Controls.Add(Me.cmbCategory)
        Me.Controls.Add(Me.cmbManuf)
        Me.Controls.Add(Me.cmbSubCat)
        Me.Controls.Add(Me.cmbBrand)
        Me.Controls.Add(Me.cmbDepartment)
        Me.Controls.Add(Me.dtpLPD)
        Me.Controls.Add(Me.dgShowroom)
        Me.Controls.Add(Me.tbMarkup1)
        Me.Controls.Add(Me.tbMarkup2)
        Me.Controls.Add(Me.tbMarkup3)
        Me.Controls.Add(Me.dgSuppliers)
        Me.Controls.Add(Me.tbPrice3)
        Me.Controls.Add(Me.tbPrice2)
        Me.Controls.Add(Me.tbPrice1)
        Me.Controls.Add(Me.tbLongDescE)
        Me.Controls.Add(Me.TextBox1)
        Me.Controls.Add(Me.dgBarcode)
        Me.Controls.Add(Me.tbShortDescE)
        Me.Controls.Add(Me.tbManuf)
        Me.Controls.Add(Me.tbProdCode)
        Me.Controls.Add(Me.pbImage)
        Me.Controls.Add(Me.GroupPanel1)
        Me.Controls.Add(Me.GroupBox4)
        Me.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ForeColor = System.Drawing.SystemColors.ControlLightLight
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Location = New System.Drawing.Point(70, 70)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmProductMasterAdd"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        CType(Me.dgShowroom, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.pbImage, System.ComponentModel.ISupportInitialize).EndInit()
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox1.PerformLayout()
        CType(Me.dgBarcode, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.dgSuppliers, System.ComponentModel.ISupportInitialize).EndInit()
        Me.GroupBox2.ResumeLayout(False)
        Me.GroupBox2.PerformLayout()
        Me.GroupBox3.ResumeLayout(False)
        Me.GroupBox3.PerformLayout()
        CType(Me.dgProduct, System.ComponentModel.ISupportInitialize).EndInit()
        Me.GroupBox4.ResumeLayout(False)
        Me.GroupBox4.PerformLayout()
        Me.GroupPanel1.ResumeLayout(False)
        Me.GroupPanel1.PerformLayout()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region
    Dim util As New AppsUtility.EncDec
    Public strCon As String = util.toDecrypt(ConfigurationManager.AppSettings("SQLString"))
    Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
        Me.Close()
    End Sub
    Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
        Dim ItemType As Integer
        ItemType = 1
        If rbStock.Checked = True Then
            ItemType = 1
        Else
            If rbSample.Checked = True Then
                ItemType = 2
            Else
                If rbNonStock.Checked = True Then
                    ItemType = 3
                End If
            End If
        End If
        Dim ProductIndicator As Integer
        ProductIndicator = 1
        If rbActiveProd.Checked = True Then
            ProductIndicator = 1
        Else
            If rbTempDisc.Checked = True Then
                ProductIndicator = 2
            Else
                If rbRangedOut.Checked = True Then
                    ProductIndicator = 3
                Else
                    If rbToBePurged.Checked = True Then
                        ProductIndicator = 4
                    Else
                        If rbNIOH.Checked = True Then
                            ProductIndicator = 6
                        Else
                            If rbPCI.Checked = True Then
                                ProductIndicator = 7
                            End If
                        End If
                    End If
                End If
            End If
        End If
        Dim ActiveFlag As Integer
        If chActive.Checked = True Then
            ActiveFlag = 1
        Else
            ActiveFlag = 0
        End If
        Dim OnPromotionFlag As Integer
        If chOnPromotion.Checked = True Then
            OnPromotionFlag = 1
        Else
            OnPromotionFlag = 0
        End If
        Dim KitFlag As Integer
        If chKit.Checked = True Then
            KitFlag = 1
        Else
            KitFlag = 0
        End If
        Dim WhProductFlag As Integer
        If chWhProduct.Checked = True Then
            WhProductFlag = 1
        Else
            WhProductFlag = 0
        End If
        Dim ICdata As New ICdataLogic

        If ValidateInputData() = True Then
            Dim ShowroomXml As String
            Dim BarCodeXml As String
            Dim rowCount2 As Integer = dgBarcode.BindingContext(dgBarcode.DataSource, dgBarcode.DataMember).Count
            Dim row2 As Integer = 0

            BarCodeXml = "<BarCodes><BarCode>" & tbProdCode.Text.Trim & "</BarCode>"
            Dim BarCodeEntry As Boolean = False
            For row2 = 0 To rowCount2 - 1
                If dgBarcode(row2, 0).ToString.Trim <> "" Then
                    If dgBarcode(row2, 0).ToString.Trim <> tbProdCode.Text.Trim Then
                        If ICdata.IsBarCodeExist(dgBarcode(row2, 0).ToString.Trim) = True Then
                            MsgBox("Barcode already exist:" + dgBarcode(row2, 0).ToString.Trim, MsgBoxStyle.Exclamation, "Inventory Manager")
                            dgBarcode.Focus()
                            Exit Sub
                        End If
                        BarCodeXml += "<BarCode>" & dgBarcode(row2, 0).ToString.Trim & "</BarCode>"
                        BarCodeEntry = True
                    End If
                End If
            Next
            BarCodeXml += "</BarCodes>"
            If BarCodeEntry = False Then
                MsgBox("Barcode should be entered", MsgBoxStyle.Exclamation, "Inventory Manager")
                dgBarcode.Focus()
                Exit Sub
            End If
            '

            Dim rowCount As Integer = dgShowroom.BindingContext(dgShowroom.DataSource, dgShowroom.DataMember).Count
            Dim row As Integer = 0
            Dim ShowroomID As Integer
            Dim RolQty As Decimal
            ShowroomXml = "<ShowRooms>"
            For row = 0 To rowCount - 1
                ShowroomID = dgShowroom(row, 0)
                RolQty = dgShowroom(row, 2)
                ShowroomXml += "<Showroom>" & "<ID>" & ShowroomID & "</ID><QTY>" & RolQty & "</QTY></Showroom>"
            Next
            ShowroomXml += "</ShowRooms>"
            '
            Dim ProdSupXml As String
            rowCount = dgSuppliers.BindingContext(dgSuppliers.DataSource, dgSuppliers.DataMember).Count
            row = 0
            Dim SupEntry As Boolean = False
            Dim SupID As Integer
            ProdSupXml = "<ProdSups>"
            For row = 0 To rowCount - 1
                If dgSuppliers(row, 2) = True Then
                    SupID = dgSuppliers(row, 0)
                    ProdSupXml += "<Supplier><ID>" & SupID & "</ID></Supplier>"
                    SupEntry = True
                End If
            Next
            ProdSupXml += "</ProdSups>"
            If SupEntry = False Then
                MsgBox("Atleast one supplier to be selected", MsgBoxStyle.Exclamation, "Inventory Manager")
                dgSuppliers.Focus()
                Exit Sub
            End If
            '
            tbShortDescE.Text = tbShortDescE.Text.Replace("'", " ")
            tbShortDescA.Text = tbShortDescA.Text.Replace("'", " ")
            tbLongDescE.Text = tbLongDescE.Text.Replace("'", " ")
            tbLongDescA.Text = tbLongDescA.Text.Replace("'", " ")
            tbShortDescE.Text = tbShortDescE.Text.Replace("&", " ")
            tbShortDescA.Text = tbShortDescA.Text.Replace("&", " ")
            tbLongDescE.Text = tbLongDescE.Text.Replace("&", " ")
            tbLongDescA.Text = tbLongDescA.Text.Replace("&", " ")
            tbShortDescE.Text = tbShortDescE.Text.Replace(">", " ")
            tbShortDescA.Text = tbShortDescA.Text.Replace(">", " ")
            tbLongDescE.Text = tbLongDescE.Text.Replace(">", " ")
            tbLongDescA.Text = tbLongDescA.Text.Replace(">", " ")
            tbShortDescE.Text = tbShortDescE.Text.Replace("<", " ")
            tbShortDescA.Text = tbShortDescA.Text.Replace("<", " ")
            tbLongDescE.Text = tbLongDescE.Text.Replace("<", " ")
            tbLongDescA.Text = tbLongDescA.Text.Replace("<", " ")
            tbShortDescE.Text = tbShortDescE.Text.Replace(",", " ")
            tbShortDescA.Text = tbShortDescA.Text.Replace(",", " ")
            tbLongDescE.Text = tbLongDescE.Text.Replace(",", " ")
            tbLongDescA.Text = tbLongDescA.Text.Replace(",", " ")

            Dim LPD As Date
            If chkLPD.CheckState = True Then
                LPD = dtpLPD.Value.ToShortDateString
            Else
                LPD = "1900-01-01"
            End If

            Try
                ICdata.InsertProductData(CompanyID, cmbDepartment.SelectedValue, tbManuf.Text, _
                        tbProdCode.Text, tbShortDescE.Text, tbShortDescA.Text, _
                        tbLongDescE.Text, tbLongDescA.Text, cmbBrand.SelectedValue, _
                        cmbManuf.SelectedValue, cmbCategory.SelectedValue, cmbSubCat.SelectedValue, _
                        tbPrice1.Text.Replace(",", ""), tbPrice2.Text.Replace(",", ""), tbPrice3.Text.Replace(",", ""), tbMarkup1.Text.Replace(",", ""), _
                        tbMarkup2.Text.Replace(",", ""), tbMarkup3.Text.Replace(",", ""), cmbUnit.SelectedItem.ToString(), tbROL.Text, _
                        tbLeadTime.Text, cmbLead.SelectedItem.ToString(), ItemType, ProductIndicator, tbOuterPack.Text, _
                        cmbPack.SelectedItem.ToString(), tbImageFile.Text, ActiveFlag, OnPromotionFlag, _
                        KitFlag, WhProductFlag, cmbSubSubCat.SelectedValue, 0, 0, ShowroomXml, BarCodeXml, ProdSupXml, LPD)
                MsgBox("Product:" & tbProdCode.Text & " added.", MsgBoxStyle.Information, "Inventory Manager")
                ICdata.UpdateBMPRODUCT(tbProdCode.Text, TextBox1.Text)

                ClearFields()
            Catch Ex As Exception
                MsgBox("Unable to satisfy your request." & vbLf & "Try again later.", MsgBoxStyle.Critical, "Inventory Manager")
            Finally
                ICdata = Nothing
            End Try
        End If
    End Sub
    Private Sub ICproductsAdd_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        Me.Dispose()
    End Sub

    Private Sub LoadBarCodes(ByVal CompanyCode As Integer, ByVal ProdID As Integer)
        Dim ICdata As New ICdataLogic
        Dim ds As DataSet
        ds = ICdata.GetProductBarCodeEntryList(ProdID)
        dgBarcode.DataSource = ds.Tables(0)
        ICdata = Nothing
        With dgBarcode
            .TableStyles.Clear()
            .CaptionBackColor = System.Drawing.Color.SlateBlue
            .CaptionForeColor = System.Drawing.Color.LemonChiffon
            .AllowSorting = True
            .AlternatingBackColor = System.Drawing.Color.AliceBlue
            .ParentRowsBackColor = System.Drawing.Color.Lavender
            .ParentRowsForeColor = System.Drawing.Color.SlateBlue
            .HeaderBackColor = System.Drawing.Color.LemonChiffon
            .AllowNavigation = True
            .ParentRowsVisible = False
            .RowHeadersVisible = False
        End With
        Dim cm As CurrencyManager = BindingContext(dgBarcode.DataSource, dgBarcode.DataMember)
        Dim dv As DataView = cm.List
        'dv.AllowNew = False
        dgformat3(ds.Tables(0).Rows.Count)
    End Sub
    Private Sub dgformat3(ByVal RowCount As Integer)
        Dim grdTableStyle As New DataGridTableStyle
        With grdTableStyle
            .AlternatingBackColor = Color.AliceBlue
            .HeaderFont = New Font("calibri", 9.0!, FontStyle.Bold)
            .MappingName = "BARCODE"
            .PreferredColumnWidth = 140
            .HeaderBackColor = Color.LightSlateGray
            .HeaderForeColor = Color.LightCyan
            .PreferredRowHeight = 15
            .RowHeadersVisible = False
            .RowHeaderWidth = 0
            .ColumnHeadersVisible = False
        End With
        Dim cs1 As DataGridColumnStyle
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 128
        cs1.MappingName = "PRODUCTBARCODE"
        cs1.HeaderText = ""
        cs1.NullText = ""
        cs1.ReadOnly = False
        grdTableStyle.GridColumnStyles.Add(cs1)
        dgBarcode.TableStyles.Add(grdTableStyle)
    End Sub
    Private Sub ClearFields()
        TextBox1.Text = ""
        tbProdCode.Text = ""
        tbManuf.Text = ""
        tbShortDescE.Text = ""
        tbShortDescA.Text = ""
        tbLongDescE.Text = ""
        tbLongDescA.Text = ""
        tbPrice1.Text = ""
        tbPrice2.Text = ""
        tbPrice3.Text = ""
        tbMarkup3.Text = ""
        tbMarkup2.Text = ""
        tbMarkup1.Text = ""
        tbROL.Text = ""
        tbImageFile.Text = ""
        tbOuterPack.Text = ""
        tbLeadTime.Text = ""
        rbActiveProd.Checked = True
        LoadBarCodes(CompanyID, 0)
        LoadShowrooms(CompanyID)
        tbManuf.Focus()
    End Sub
    Private Sub ICproductsAdd_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        cmbUnit.SelectedItem = "PCS"
        cmbPack.SelectedItem = "CFT"
        cmbLead.SelectedItem = "DAYS"
        LoadGroupCombos(CompanyID)
        LoadShowrooms(CompanyID)
        LoadSuppliers(CompanyID)
        LoadBarCodes(CompanyID, 0)
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, 0, 132) = True Then
            chActive.Enabled = True
        Else
            chActive.Enabled = False
        End If
        If ApData.IsValidUserOption(UserID, 0, 134) = True Then
            chOnPromotion.Enabled = True
        Else
            chOnPromotion.Enabled = False
        End If
        If ApData.IsValidUserOption(UserID, 0, 137) = True Then
            chKit.Enabled = True
        Else
            chKit.Enabled = False
        End If
        ApData = Nothing

        Dim sqlCon As SqlConnection = New SqlConnection(strCon)
        Dim strsql As String

        strsql = "select m.* from  Product m with (NoLock) "

        sqlCon.Open()
        Dim da As New SqlClient.SqlDataAdapter(strsql, sqlCon)
        Dim ds As New DataSet("PRODUCT")
        Try
            da.SelectCommand.CommandTimeout = 1800
            da.Fill(ds, "PRODUCT")
        Catch ex As SqlException
            MsgBox(ex.ToString())
        End Try
        'MessageBox.Show(strsql)
        sqlCon.Close()
        dgProduct.DataSource = ds.Tables("PRODUCT")
        'SmallGrid.DataSource = ds.Tables(0)
        With dgProduct
            ' .BackgroundColor = GridBackgroundColor
            .TableStyles.Clear()
            .CaptionBackColor = System.Drawing.Color.SlateBlue
            .CaptionForeColor = System.Drawing.Color.LemonChiffon
            .AllowSorting = True
            .AlternatingBackColor = System.Drawing.Color.AliceBlue
            .ParentRowsBackColor = System.Drawing.Color.Lavender
            .ParentRowsForeColor = System.Drawing.Color.SlateBlue
            .HeaderBackColor = System.Drawing.Color.LemonChiffon
            .AllowNavigation = False
            .ParentRowsVisible = False
            .RowHeadersVisible = False
        End With
        Dim cm As CurrencyManager = BindingContext(dgProduct.DataSource, dgProduct.DataMember)
        Dim dv As DataView = cm.List
        dv.AllowNew = False
        'smformat(ds.Tables(0).Rows.Count)
        dgformatt(ds.Tables("PRODUCT").Rows.Count)
        'ICdata = Nothing
        Me.Cursor = Cursors.Default


        strsql = "select distinct(PoNumber) from " & _
              " BM_PurchaseOrderHead where PoStatus = 'PENDING'"

        sqlCon.Open()
        Dim da1 As New SqlClient.SqlDataAdapter(strsql, sqlCon)
        Dim ds1 As New DataSet()
        Try
            da1.SelectCommand.CommandTimeout = 1800
            da1.Fill(ds1)
        Catch ex As SqlException
            MsgBox(ex.ToString())
        End Try
        'MessageBox.Show(strsql)
        sqlCon.Close()


        cmbPOfilter.DataSource = ds1.Tables(0)
        cmbPOfilter.ValueMember = "PoNumber"
        cmbPOfilter.DisplayMember = "PoNumber"
        cmbPOfilter.SelectedValue = 0

        Me.Location = New Point(95, 80)

    End Sub
    Private Sub LoadShowrooms(ByVal CompanyCode As Integer)
        Dim ICdata As New ICdataLogic
        Dim ds As DataSet
        ds = ICdata.GetShowroomsRolPrompt(CompanyCode)
        dgShowroom.DataSource = ds.Tables(0)
        ICdata = Nothing
        With dgShowroom
            .TableStyles.Clear()
            .CaptionBackColor = System.Drawing.Color.SlateBlue
            .CaptionForeColor = System.Drawing.Color.LemonChiffon
            .AllowSorting = True
            .AlternatingBackColor = System.Drawing.Color.AliceBlue
            .ParentRowsBackColor = System.Drawing.Color.Lavender
            .ParentRowsForeColor = System.Drawing.Color.SlateBlue
            .HeaderBackColor = System.Drawing.Color.LemonChiffon
            .AllowNavigation = False
            .ParentRowsVisible = False
            .RowHeadersVisible = False
        End With
        Dim cm As CurrencyManager = BindingContext(dgShowroom.DataSource, dgShowroom.DataMember)
        Dim dv As DataView = cm.List
        dv.AllowNew = False
        dgformat(ds.Tables(0).Rows.Count)
    End Sub
    Private Sub dgformat(ByVal RowCount As Integer)
        Dim grdTableStyle As New DataGridTableStyle
        With grdTableStyle
            .AlternatingBackColor = Color.AliceBlue
            .HeaderFont = New Font("Tahoma", 8.0!, FontStyle.Bold)
            .MappingName = "SHOWROOM"
            .PreferredColumnWidth = 140
            .HeaderBackColor = Color.LightSlateGray
            .HeaderForeColor = Color.LightCyan
            .PreferredRowHeight = 15
            .RowHeadersVisible = False
            .RowHeaderWidth = 0
        End With
        Dim cs1 As DataGridColumnStyle
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 0
        cs1.MappingName = "DEPARTMENTID"
        cs1.HeaderText = "ID"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 195
        cs1.MappingName = "DEPARTMENTNAME"
        cs1.HeaderText = "SHOWROOM"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        'If RowCount > 3 Then
        '    cs1.Width = 58
        'Else
        '    cs1.Width = 74
        'End If
        cs1.MappingName = "MINIMUMQTY"
        cs1.HeaderText = "ROL"
        cs1.NullText = ""
        cs1.Width = 45
        cs1.ReadOnly = False
        cs1.Alignment = HorizontalAlignment.Right
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        dgShowroom.TableStyles.Add(grdTableStyle)
    End Sub
    Private Sub LoadSuppliers(ByVal CompanyCode As Integer)
        Dim ICdata As New ICdataLogic
        Dim ds As DataSet
        'ds = ICdata.GetSuppliersProdPrompt(CompanyCode)
        ds = ICdata.GetCompanySuppliers(CompanyCode)
        dgSuppliers.DataSource = ds.Tables(0)
        ICdata = Nothing
        With dgSuppliers
            .TableStyles.Clear()
            .CaptionBackColor = System.Drawing.Color.SlateBlue
            .CaptionForeColor = System.Drawing.Color.LemonChiffon
            .AllowSorting = True
            .AlternatingBackColor = System.Drawing.Color.AliceBlue
            .ParentRowsBackColor = System.Drawing.Color.Lavender
            .ParentRowsForeColor = System.Drawing.Color.SlateBlue
            .HeaderBackColor = System.Drawing.Color.LemonChiffon
            .AllowNavigation = False
            .ParentRowsVisible = False
            .RowHeadersVisible = False
        End With
        Dim cm As CurrencyManager = BindingContext(dgShowroom.DataSource, dgShowroom.DataMember)
        Dim dv As DataView = cm.List
        dv.AllowNew = False
        dgformat2(ds.Tables(0).Rows.Count)
    End Sub
    Private Sub dgformat2(ByVal RowCount As Integer)
        Dim grdTableStyle2 As New DataGridTableStyle
        With grdTableStyle2
            .AlternatingBackColor = Color.AliceBlue
            .HeaderFont = New Font("Tahoma", 8.0!, FontStyle.Bold)
            .MappingName = "SUPPLIER"
            .PreferredColumnWidth = 140
            .HeaderBackColor = Color.LightSlateGray
            .HeaderForeColor = Color.LightCyan
            .PreferredRowHeight = 15
            .RowHeadersVisible = False
            .RowHeaderWidth = 0
        End With
        Dim cs1 As DataGridColumnStyle
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 0
        cs1.MappingName = "SUPID"
        cs1.HeaderText = "ID"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle2.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 173
        cs1.MappingName = "SUPNAME"
        cs1.HeaderText = "NAME"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle2.GridColumnStyles.Add(cs1)
        '
        Dim cs2 As DataGridBoolColumn
        cs2 = New DataGridBoolColumn
        cs2.Width = 20
        cs2.MappingName = "VALIDSUP"
        cs2.ReadOnly = False
        cs2.FalseValue = 0
        cs2.TrueValue = 1
        cs2.AllowNull = False
        'SetBoolColumnValues()
        grdTableStyle2.GridColumnStyles.Add(cs2)
        '
        dgSuppliers.TableStyles.Add(grdTableStyle2)
        ''
    End Sub
    Private Sub LoadGroupCombos(ByVal CompanyCode As Integer)
        Dim ICdata As New ICdataLogic
        Dim ds As DataSet

        ds = ICdata.GetAllProductGroups(3)
        cmbManuf.DataSource = ds.Tables(0)
        cmbManuf.ValueMember = "GroupID"
        cmbManuf.DisplayMember = "GroupName"
        cmbManuf.SelectedValue = 0
        '
        ds = ICdata.GetAllProductGroups(1)
        cmbDepartment.DataSource = ds.Tables(0)
        cmbDepartment.ValueMember = "GroupID"
        cmbDepartment.DisplayMember = "GroupName"
        cmbDepartment.SelectedValue = 0
        '
        ds = ICdata.GetAllProductGroups(2)
        cmbBrand.DataSource = ds.Tables(0)
        cmbBrand.ValueMember = "GroupID"
        cmbBrand.DisplayMember = "GroupName"
        cmbBrand.SelectedValue = 0
        '
        ds = ICdata.GetAllProductGroups(4)
        cmbCategory.DataSource = ds.Tables(0)
        cmbCategory.ValueMember = "GroupID"
        cmbCategory.DisplayMember = "GroupName"
        cmbCategory.SelectedValue = 0
        '
        ds = ICdata.GetAllProductGroups(5)
        cmbSubCat.DataSource = ds.Tables(0)
        cmbSubCat.ValueMember = "GroupID"
        cmbSubCat.DisplayMember = "GroupName"
        cmbSubCat.SelectedValue = 0
        '
        ds = ICdata.GetAllProductGroups(6)
        cmbSubSubCat.DataSource = ds.Tables(0)
        cmbSubSubCat.ValueMember = "GroupID"
        cmbSubSubCat.DisplayMember = "GroupName"
        cmbSubSubCat.SelectedValue = 0
        '
        ds = ICdata.GetAllProductGroups(7)
        cmbGroup7.DataSource = ds.Tables(0)
        cmbGroup7.ValueMember = "GroupID"
        cmbGroup7.DisplayMember = "GroupName"
        cmbGroup7.SelectedValue = 0
        '
        ds = ICdata.GetAllProductGroups(8)
        CmbGroup8.DataSource = ds.Tables(0)
        CmbGroup8.ValueMember = "GroupID"
        CmbGroup8.DisplayMember = "GroupName"
        CmbGroup8.SelectedValue = 0
        '
        ICdata = Nothing
    End Sub
    Private Sub GenerateProductCode()
        Dim BrandCode As String
        Dim ICdata As New ICdataLogic
        BrandCode = ICdata.GetBrandCode(cmbManuf.SelectedValue)
        ICdata = Nothing
        If BrandCode <> "" And tbManuf.Text <> "" Then
            tbProdCode.Text = BrandCode.Trim + tbManuf.Text
            CheckProductCode(tbProdCode.Text)
        Else
            tbProdCode.Text = ""
        End If
    End Sub
    Private Sub CheckProductCode(ByVal ProdCode As String)
        Dim ICdata As New ICdataLogic
        If ICdata.ProductCodeExist(CompanyID, ProdCode) = True Then
            MsgBox("Product code already exist.", MsgBoxStyle.Critical, "Inventory Manager")
            tbManuf.Text = ""
            tbProdCode.Text = ""
        End If
    End Sub
    Private Sub btnImage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnImage.Click
        dlgOpen.ShowDialog()
        tbImageFile.Text = dlgOpen.FileName.ToString
        ShowImage(tbImageFile.Text)
    End Sub

    Public Sub ShowImage(ByVal fileToDisplay As String)
        Dim MyImage As Bitmap
        If Not (MyImage Is Nothing) Then
            MyImage.Dispose()
        End If
        pbImage.SizeMode = PictureBoxSizeMode.StretchImage
        pbImage.Visible = True
        Try
            MyImage = New Bitmap(fileToDisplay)
            pbImage.ClientSize = New Size(140, 121)
            pbImage.Image = CType(MyImage, Image)
        Catch ex As Exception
            tbImageFile.Text = ""
            MsgBox("Invalid Image File", MsgBoxStyle.Exclamation, "Inventory Manager")
            pbImage.Visible = False
            tbImageFile.Focus()
        End Try
    End Sub

    Private Sub tbImageFile_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles tbImageFile.Validating
        If tbImageFile.Text.Trim <> "" Then
            ShowImage(tbImageFile.Text)
        Else
            pbImage.Visible = False
        End If
    End Sub

    Private Sub tbPrice1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbPrice1.LostFocus
        If tbPrice1.Text.Trim <> "" Then
            If IsNumeric(tbPrice1.Text) Then
                tbPrice1.Text = FormatNumber(tbPrice1.Text, 3)
            Else
                MsgBox("Only numbers allowed for Price1", MsgBoxStyle.Information, "Inventory Manager")
                tbPrice1.Focus()
            End If
        End If
    End Sub

    Private Sub tbPrice2_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbPrice2.LostFocus
        If tbPrice2.Text.Trim <> "" Then
            If IsNumeric(tbPrice2.Text) Then
                tbPrice2.Text = FormatNumber(tbPrice2.Text, 3)
            Else
                MsgBox("Only numbers allowed for Price2", MsgBoxStyle.Information, "Inventory Manager")
                tbPrice2.Focus()
            End If
        End If
    End Sub

    Private Sub tbPrice3_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbPrice3.LostFocus
        If tbPrice3.Text.Trim <> "" Then
            If IsNumeric(tbPrice3.Text) Then
                tbPrice3.Text = FormatNumber(tbPrice3.Text, 3)
            Else
                MsgBox("Only numbers allowed for Price1", MsgBoxStyle.Information, "Inventory Manager")
                tbPrice3.Focus()
            End If
        End If
    End Sub

    Private Sub tbMarkup1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbMarkup1.LostFocus
        If tbMarkup1.Text.Trim <> "" Then
            If IsNumeric(tbMarkup1.Text) Then
                tbMarkup1.Text = FormatNumber(tbMarkup1.Text, 2)
            Else
                MsgBox("Only numbers allowed for Markup1", MsgBoxStyle.Information, "Inventory Manager")
                tbMarkup1.Focus()
            End If
        End If
    End Sub

    Private Sub tbMarkup2_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbMarkup2.LostFocus
        If tbMarkup2.Text.Trim <> "" Then
            If IsNumeric(tbMarkup2.Text) Then
                tbMarkup2.Text = FormatNumber(tbMarkup2.Text, 2)
            Else
                MsgBox("Only numbers allowed for Markup2", MsgBoxStyle.Information, "Inventory Manager")
                tbMarkup2.Focus()
            End If
        End If
    End Sub

    Private Sub tbMarkup3_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbMarkup3.LostFocus
        If tbMarkup3.Text.Trim <> "" Then
            If IsNumeric(tbMarkup3.Text) Then
                tbMarkup3.Text = FormatNumber(tbMarkup3.Text, 2)
            Else
                MsgBox("Only numbers allowed for Markup3", MsgBoxStyle.Information, "Inventory Manager")
                tbMarkup3.Focus()
            End If
        End If
    End Sub
    Private Sub tbROL_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbROL.LostFocus
        If tbROL.Text.Trim <> "" Then
            If Not IsNumeric(tbROL.Text) Then
                MsgBox("Only numbers allowed for ROL", MsgBoxStyle.Information, "Inventory Manager")
                tbROL.Focus()
            End If
        End If
    End Sub

    Private Sub tbOuterPack_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbOuterPack.LostFocus
        If tbOuterPack.Text.Trim <> "" Then
            If Not IsNumeric(tbOuterPack.Text) Then
                MsgBox("Only numbers allowed for Outer Pack", MsgBoxStyle.Information, "Inventory Manager")
                tbOuterPack.Focus()
            End If
        End If
    End Sub

    Private Sub tbLeadTime_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbLeadTime.LostFocus
        If tbLeadTime.Text.Trim <> "" Then
            If Not IsNumeric(tbLeadTime.Text) Then
                MsgBox("Only numbers allowed for Lead Time", MsgBoxStyle.Information, "Inventory Manager")
                tbLeadTime.Focus()
            End If
        End If
    End Sub

    Private Function ValidateInputData() As Boolean
        ValidateInputData = True
        If cmbManuf.SelectedValue = 0 Then
            MsgBox("Select Manufacturer", MsgBoxStyle.Exclamation, "Inventory Manager")
            cmbManuf.Focus()
            Return False
        End If
        If tbManuf.Text.Trim = "" Then
            MsgBox("Enter Manufacturor Product Code", MsgBoxStyle.Exclamation, "Inventory Manager")
            tbManuf.Focus()
            Return False
        End If
        If tbProdCode.Text.Trim = "" Then
            MsgBox(" Enter Product Code ", MsgBoxStyle.Exclamation, "Inventory Manager")
            tbManuf.Focus()
            Return False
        End If
        If cmbUnit.SelectedItem = "" Then
            MsgBox("Select Sale Unit", MsgBoxStyle.Exclamation, "Inventory Manager")
            cmbUnit.Focus()
            Return False
        End If
        If cmbPack.SelectedItem = "" Then
            MsgBox("Select Outer Pack Size", MsgBoxStyle.Exclamation, "Inventory Manager")
            cmbPack.Focus()
            Return False
        End If
        'If cmbPack.SelectedItem = "" Then
        '    MsgBox("Select Lead Time", MsgBoxStyle.Exclamation, "Inventory Manager")
        '    cmbPack.Focus()
        '    Return False
        'End If
        If tbPrice1.Text.Trim = "" Then
            MsgBox("Enter Price1", MsgBoxStyle.Exclamation, "Inventory Manager")
            tbPrice1.Focus()
            Return False
        Else
            If Decimal.Parse(tbPrice1.Text) <= 0 Then
                MsgBox("Enter Price1", MsgBoxStyle.Exclamation, "Inventory Manager")
                tbPrice1.Focus()
                Return False
            End If
        End If
        If tbPrice2.Text.Trim = "" Then
            MsgBox("Enter Price2", MsgBoxStyle.Exclamation, "Inventory Manager")
            tbPrice2.Focus()
            Return False
        Else
            If Decimal.Parse(tbPrice2.Text) <= 0 Then
                MsgBox("Enter Price2", MsgBoxStyle.Exclamation, "Inventory Manager")
                tbPrice2.Focus()
                Return False
            End If
        End If
        If tbPrice3.Text.Trim = "" Then
            MsgBox("Enter Price3", MsgBoxStyle.Exclamation, "Inventory Manager")
            tbPrice3.Focus()
            Return False
        Else
            If Decimal.Parse(tbPrice3.Text) <= 0 Then
                MsgBox("Enter Price3", MsgBoxStyle.Exclamation, "Inventory Manager")
                tbPrice3.Focus()
                Return False
            End If
        End If
        If tbShortDescE.Text = "" Then
            MsgBox("Enter Short Description In English", MsgBoxStyle.Exclamation, "Inventory Manager")
            tbShortDescE.Focus()
            Return False
        End If
        If cmbDepartment.SelectedValue = 0 Then
            MsgBox("Select Department", MsgBoxStyle.Exclamation, "Inventory Manager")
            cmbDepartment.Focus()
            Return False
        End If
        'If CmbGroup8.SelectedValue = 0 Then
        '    MsgBox("Select WSCategory", MsgBoxStyle.Exclamation, "Inventory Manager")
        '    CmbGroup8.Focus()
        '    Return False
        'End If
        If cmbBrand.SelectedValue = 0 Then
            MsgBox("Select Brand", MsgBoxStyle.Exclamation, "Inventory Manager")
            cmbBrand.Focus()
            Return False
        End If
        If cmbCategory.SelectedValue = 0 Then
            MsgBox("Select Category", MsgBoxStyle.Exclamation, "Inventory Manager")
            cmbCategory.Focus()
            Return False
        End If
        If cmbSubCat.SelectedValue = 0 Then
            MsgBox("Select Sub Category", MsgBoxStyle.Exclamation, "Inventory Manager")
            cmbSubCat.Focus()
            Return False
        End If
        If cmbSubSubCat.SelectedValue = 0 Then
            MsgBox("Select Sub-Sub Category", MsgBoxStyle.Exclamation, "Inventory Manager")
            cmbSubCat.Focus()
            Return False
        End If
        Return True
    End Function


    Private Sub ICproductsAdd_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
        Select Case e.KeyValue
            Case 13
                SendKeys.Send("{Tab}")
            Case 27
                cmdExit.PerformClick()
        End Select
    End Sub



    Private Sub dgSuppliers_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dgSuppliers.MouseUp
        Dim pt As New Point(e.X, e.Y)
        Dim hti As DataGrid.HitTestInfo = dgSuppliers.HitTest(pt)
        If hti.Type = DataGrid.HitTestType.Cell Then
            dgSuppliers.CurrentCell = New DataGridCell(hti.Row, hti.Column)
            dgSuppliers.Select(hti.Row)
            Dim CurrentRow As Integer = dgSuppliers.CurrentCell.RowNumber
            If dgSuppliers.Item(CurrentRow, 2) = True Then
                dgSuppliers.Item(CurrentRow, 2) = False
            Else
                dgSuppliers.Item(CurrentRow, 2) = True
            End If
        End If
    End Sub

    Private Sub tbManuf_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbManuf.Validated
        GenerateProductCode()
    End Sub

    Private Sub cmbGroup1_Validated(ByVal sender As Object, ByVal e As System.EventArgs)
        GenerateProductCode()
    End Sub

    Private Sub cmbGroup7_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbGroup7.SelectedIndexChanged

    End Sub


    Private Sub dgformatt(ByVal RowCount As Integer)
        Dim grdTableStyle As New DataGridTableStyle
        With grdTableStyle
            .AlternatingBackColor = Color.AliceBlue
            .HeaderFont = New Font("Tahoma", 8.0!, FontStyle.Bold)
            .MappingName = "PRODUCT" '
            .PreferredColumnWidth = 160
            .HeaderBackColor = Color.LightSlateGray
            .HeaderForeColor = Color.LightCyan
            .PreferredRowHeight = 15
            .RowHeadersVisible = False
            .RowHeaderWidth = 0
        End With
        Dim cs1 As DataGridColumnStyle
        '
        'cs1 = New DataGridTextBoxColumn
        'cs1.Width = 50
        'cs1.MappingName = "Dummy"
        'cs1.HeaderText = "Dummy"
        'cs1.NullText = ""
        'cs1.ReadOnly = True
        'grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 0
        cs1.MappingName = "PRODUCTID"
        cs1.HeaderText = "CODE"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 100
        cs1.MappingName = "PRODUCTCODE"
        cs1.HeaderText = "CODE"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 100
        cs1.MappingName = "MANUFPRODUCTCODE"
        cs1.HeaderText = "MANUF.CODE"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 200
        cs1.MappingName = "SHORTDESCRIPTIONE"
        cs1.HeaderText = "DESCRIPTION"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 70
        cs1.MappingName = "RSP"
        cs1.HeaderText = "RSP"
        cs1.NullText = ""
        cs1.ReadOnly = True
        cs1.Alignment = HorizontalAlignment.Right
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        '

        dgProduct.TableStyles.Add(grdTableStyle)
    End Sub

    Private Sub cmdDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDisplay.Click

        Try

            Dim Group1Code As Integer
            Dim Group2Code As Integer
            Dim Group3Code As Integer
            Dim Group4Code As Integer
            Dim Group5Code As Integer
            Dim Group6Code As Integer
            Dim Group7Code As Integer
            Dim Group8Code As Integer

            Dim OldProdCode As String

            Dim sqlCon As SqlConnection = New SqlConnection(strCon)
            Dim strsql As String

            strsql = "select * from " & _
                    " Product m with (NoLock) " & _
                    " where m.ProductCode = '" & TextBox1.Text.Trim & "'"

            sqlCon.Open()
            Dim da As New SqlClient.SqlDataAdapter(strsql, sqlCon)
            Dim ds As New DataSet()
            Try
                da.SelectCommand.CommandTimeout = 1800
                da.Fill(ds)
            Catch ex As SqlException
                MsgBox(ex.ToString())
            End Try

            strsql = "select b.PRODUCTBARCODE  from product a, BarCode b where a.PRODUCTID=b.PRODUCTID and a.ProductCode = '" & TextBox1.Text.Trim & "'"
            Dim da1 As New SqlClient.SqlDataAdapter(strsql, sqlCon)
            Dim ds1 As New DataSet()
            da1.SelectCommand.CommandTimeout = 1800
            da1.Fill(ds1)
            dgBarcode.DataSource = ds1.Tables(0)

            sqlCon.Close()

            tbProdCode.Text = ds.Tables(0).Rows(0).Item("PRODUCTCODE").ToString()
            tbManuf.Text = ds.Tables(0).Rows(0).Item("MANUFPRODUCTCODE").ToString()
            tbLeadTime.Text = ds.Tables(0).Rows(0).Item("LEADTIME").ToString()
            tbOuterPack.Text = ds.Tables(0).Rows(0).Item("OUTERPACKSIZE").ToString()
            tbImageFile.Text = ds.Tables(0).Rows(0).Item("IMAGEFILENAME").ToString()
            tbROL.Text = ds.Tables(0).Rows(0).Item("ROLQTY").ToString()
            tbMarkup3.Text = ds.Tables(0).Rows(0).Item("THIRDMARKUPPERCENT").ToString()
            tbMarkup2.Text = ds.Tables(0).Rows(0).Item("SECONDMARKUPPERCENT").ToString()
            tbMarkup1.Text = ds.Tables(0).Rows(0).Item("FIRSTMARKUPPERCENT").ToString()
            tbPrice3.Text = ds.Tables(0).Rows(0).Item("THIRDPRICE").ToString()
            tbPrice2.Text = ds.Tables(0).Rows(0).Item("SECONDPRICE").ToString()
            tbPrice1.Text = ds.Tables(0).Rows(0).Item("FIRSTPRICE").ToString()
            tbLongDescA.Text = ds.Tables(0).Rows(0).Item("LONGDESCRIPTIONA").ToString()
            tbLongDescE.Text = ds.Tables(0).Rows(0).Item("LONGDESCRIPTIONE").ToString()
            tbShortDescA.Text = ds.Tables(0).Rows(0).Item("SHORTDESCRIPTIONA").ToString()
            tbShortDescE.Text = ds.Tables(0).Rows(0).Item("SHORTDESCRIPTIONE").ToString()
            Group1Code = Integer.Parse(ds.Tables(0).Rows(0).Item("GROUP1CODE").ToString())
            Group2Code = Integer.Parse(ds.Tables(0).Rows(0).Item("GROUP2CODE").ToString())
            Group3Code = Integer.Parse(ds.Tables(0).Rows(0).Item("GROUP3CODE").ToString())
            Group4Code = Integer.Parse(ds.Tables(0).Rows(0).Item("GROUP4CODE").ToString())
            Group5Code = Integer.Parse(ds.Tables(0).Rows(0).Item("GROUP5CODE").ToString())
            Group6Code = Integer.Parse(ds.Tables(0).Rows(0).Item("GROUP6CODE").ToString())
            Group7Code = Integer.Parse(ds.Tables(0).Rows(0).Item("GROUP7CODE").ToString())
            Group8Code = Integer.Parse(ds.Tables(0).Rows(0).Item("GROUP8CODE").ToString())
            chKit.Checked = Integer.Parse(ds.Tables(0).Rows(0).Item("KITFLAG").ToString())
            chOnPromotion.Checked = Integer.Parse(ds.Tables(0).Rows(0).Item("ONPROMOTIONFLAG").ToString())
            chActive.Checked = Integer.Parse(ds.Tables(0).Rows(0).Item("ACTIVEFLAG").ToString())

            Dim ItemType As Integer = Integer.Parse(ds.Tables(0).Rows(0).Item("PRODUCTTYPE").ToString())
            If ItemType = 1 Then
                rbStock.Checked = True
            Else
                If ItemType = 2 Then
                    rbSample.Checked = True
                Else
                    If ItemType = 3 Then
                        rbNonStock.Checked = True
                    End If
                End If
            End If
            Dim ProductIndicator As Integer = Integer.Parse(ds.Tables(0).Rows(0).Item("PRODUCTINDICATOR").ToString())
            If ProductIndicator = 1 Then
                rbActiveProd.Checked = True
            Else
                If ProductIndicator = 2 Then
                    rbTempDisc.Checked = True
                Else
                    If ProductIndicator = 3 Then
                        rbRangedOut.Checked = True
                    Else
                        If ProductIndicator = 4 Then
                            rbToBePurged.Checked = True
                        Else
                            If ProductIndicator = 6 Then
                                rbNIOH.Checked = True
                            Else
                                If ProductIndicator = 7 Then
                                    rbPCI.Checked = True
                                End If
                            End If
                        End If
                    End If
                End If
            End If

            cmbUnit.SelectedItem = ds.Tables(0).Rows(0).Item("SALEUNIT").ToString()
            cmbPack.SelectedItem = ds.Tables(0).Rows(0).Item("PACKVOLUMETYPE").ToString()
            cmbLead.SelectedItem = ds.Tables(0).Rows(0).Item("LEADTIMETYPE").ToString()
            OldProdCode = tbProdCode.Text

            cmbManuf.SelectedValue = Group3Code
            cmbDepartment.SelectedValue = Group1Code
            cmbBrand.SelectedValue = Group2Code
            cmbCategory.SelectedValue = Group4Code
            cmbSubCat.SelectedValue = Group5Code
            cmbSubSubCat.SelectedValue = Group6Code
            cmbGroup7.SelectedValue = Group7Code
            CmbGroup8.SelectedValue = Group8Code

            If tbImageFile.Text.Trim <> "" Then
                ShowImage(tbImageFile.Text)
            End If
        Catch ex As Exception
            MessageBox.Show(ex.ToString())
        End Try

    End Sub

    Private Sub cmdFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFilter.Click
        ''BM Products
        'dgProduct.

        Dim sqlCon As SqlConnection = New SqlConnection(strCon)
        Dim strsql As String

        strsql = "select m.* from " & _
                " BM_Product m, BM_PurchaseOrderHead h, BM_PurchaseOrderData d " & _
                " where  m.reference like '%N%' and h.PoID = d.PoID and h.PoNumber = '" & cmbPOfilter.SelectedValue & "' and m.ProductCode = d.PoProdCode "
        'MessageBox.Show(strsql)
        sqlCon.Open()
        Dim da As New SqlClient.SqlDataAdapter(strsql, sqlCon)
        Dim ds As New DataSet("PRODUCT")
        Try
            da.SelectCommand.CommandTimeout = 1800
            da.Fill(ds, "PRODUCT")
        Catch ex As SqlException
            MsgBox(ex.ToString())
        End Try
        'MessageBox.Show(strsql)
        sqlCon.Close()
        dgProduct.DataSource = ds.Tables("PRODUCT")
        'SmallGrid.DataSource = ds.Tables(0)
        With dgProduct
            ' .BackgroundColor = GridBackgroundColor
            .TableStyles.Clear()
            .CaptionBackColor = System.Drawing.Color.SlateBlue
            .CaptionForeColor = System.Drawing.Color.LemonChiffon
            .AllowSorting = True
            .AlternatingBackColor = System.Drawing.Color.AliceBlue
            .ParentRowsBackColor = System.Drawing.Color.Lavender
            .ParentRowsForeColor = System.Drawing.Color.SlateBlue
            .HeaderBackColor = System.Drawing.Color.LemonChiffon
            .AllowNavigation = False
            .ParentRowsVisible = False
            .RowHeadersVisible = False
        End With
        Dim cm As CurrencyManager = BindingContext(dgProduct.DataSource, dgProduct.DataMember)
        Dim dv As DataView = cm.List
        dv.AllowNew = False
        'smformat(ds.Tables(0).Rows.Count)
        dgformatt(ds.Tables("PRODUCT").Rows.Count)
        'ICdata = Nothing
        Me.Cursor = Cursors.Default


        ''end of BM Products
    End Sub


End Class
